using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using PetaPoco;

namespace BlazorAdmin.Models
{
	[PrimaryKey("ID")]
	[TableName($"{nameof(Organize)}s")]
	public class Organize
	{
		/// <summary>
		/// 主键
		/// </summary>
		[NotNull]
		[DisplayName("主键")]
		public int ID { get; set; }

		/// <summary>
		/// 获取或设置 组织代码 Allow Null
		/// </summary>
		[NotNull]
		[DisplayName("组织代码")]
		[MaxLength(30, ErrorMessage = "{0}不能超过 30 个字符")]
		public string OrgCode { get; set; }

		/// <summary>
		/// 获取或设置 组织图标 Allow Null
		/// </summary>
		[AllowNull]
		[DisplayName("组织图标")]
		[MaxLength(30, ErrorMessage = "{0}不能超过 30 个字符")]
		public string OrgIcon { get; set; }

		/// <summary>
		/// 获取或设置 父组织代码 Allow Null
		/// </summary>
		[AllowNull]
		[DisplayName("父组织代码")]
		[MaxLength(30, ErrorMessage = "{0}不能超过 30 个字符")]
		public string ParentOrgCode { get; set; }

		/// <summary>
		/// 获取或设置 组织名称 Allow Null
		/// </summary>
		[NotNull]
		[DisplayName("组织名称")]
		[MaxLength(60, ErrorMessage = "{0}不能超过 60 个字符")]
		public string OrgName { get; set; }

		/// <summary>
		/// 获取或设置 组织描述 Allow Null
		/// </summary>
		[AllowNull]
		[DisplayName("组织描述")]
		[MaxLength(255, ErrorMessage = "{0}不能超过 255 个字符")]
		public string OrgDescription { get; set; }

		/// <summary>
		/// 获取或设置 是否启用 Allow Null
		/// </summary>
		[AllowNull]
		[DisplayName("是否启用")]
		[MaxLength(1, ErrorMessage = "{0}不能超过 1 个字符")]
		public bool IsEnable { get; set; }

		/// <summary>
		/// 获取或设置 组织排序 Allow Null
		/// </summary>
		[AllowNull]
		[DisplayName("组织排序")]
		public int Sort { get; set; }

		/// <summary>
		/// 获取或设置 修改人 Allow Null
		/// </summary>
		[AllowNull]
		[DisplayName("修改人")]
		[MaxLength(32, ErrorMessage = "{0}不能超过 32 个字符")]
		public string ModifyUser { get; set; }

		/// <summary>
		/// 获取或设置 修改时间 Allow Null
		/// </summary>
		[AllowNull]
		[DisplayName("修改时间")]
		public DateTime ModifyTime { get; set; }
	}
}
